/*
 * Below is the given application for lab2_2.
 */

#include "user_lib.h"
#include "util/types.h"

struct my_structure {
  char c;
  int n;
};

int main(void) {
  //printu("user app on\n");
  struct my_structure* s = (struct my_structure*)naive_malloc();
  s->c = 'a';
  s->n = 1;

  printu("s: %lx, {%c %d}\n", s, s->c, s->n);
  

  struct my_structure* sss = (struct my_structure*)naive_malloc();
  sss->c = 'b';
  sss->n = 2;
  printu("sss: %lx, {%c %d}\n", sss, sss->c, sss->n);
  
  
  struct my_structure* ss = (struct my_structure*)huge_malloc();
  ss->c = 'c';
  ss->n = 3;
  printu("ss: %lx, {%c %d}\n", ss, ss->c, ss->n);

  struct my_structure* ss2 = (struct my_structure*)huge_malloc();
  ss2->c = 'd';
  ss2->n = 4;
  printu("ss2: %lx, {%c %d}\n", ss2, ss2->c, ss2->n);
  naive_free(sss);
  huge_free(ss);
  naive_free(s);
  huge_free(ss2);
  exit(0);
}
